import { defineStore } from 'pinia'
import { ref } from 'vue'

export const useAuthStore = defineStore(
  'auth',
  () => {
    const authComponentList = ref([])
    const setauthComponentList = (newAuthComponentList) => { authComponentList.value = newAuthComponentList }
    const removeauthComponentList = () => { authComponentList.value = [] }
    const authPermissionList = ref([])
    const setauthPermissionList = (newAuthPermissionList) => (authPermissionList.value = newAuthPermissionList)
    const removeauthPermissionList = () => (authPermissionList.value = [])
    const authMenuList = ref([])
    const setauthMenuList = (newAuthMenuList) => { authMenuList.value = newAuthMenuList }
    const removeauthMenuList = () => { authMenuList.value = [] }

    return {
      authComponentList, setauthComponentList, removeauthComponentList,
      authPermissionList, setauthPermissionList, removeauthPermissionList,
      authMenuList, setauthMenuList, removeauthMenuList
    }
  },
  { persist: true }
)